<?php
namespace app\common\repositories\info;
use app\common\repositories\BaseRepository;
use app\common\dao\info\QuestionDao as dao;
/**
 * @mixin dao
 */
class QuestionRepository extends BaseRepository
{
    public function __construct(dao $dao)
    {
        $this->dao = $dao;
    }


    public function detail($info_id)
    {
        $info = app()->make(InfoRepository::class)->getWhere(['info_id'=>$info_id],'content,info_id');

        $record = $this->dao->getSearch()->where('info_id',$info_id)->append(['userInfo'])->order('create_time asc')->select();
        return compact('info','record');
    }
}